<template>
    <h1>自定义组件</h1>
    <h2>{{$route.params.name}}</h2>
    <button @click="get">路由</button>
</template>

<script>
    export default {
        name: 'custom',
        methods:{
            get(){
                console.log(this.$route);
                console.log(this.$router);
            }
        }
    }
</script>